package org.dyz.banana.platform.business.system.test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class ConsumerController {

	@Autowired
    private RestTemplate restTemplate;
	
	/**
	 * 直接调用post模块的hello方法
	 * @return
	 */
    @GetMapping("/article/callHello")
    public String callHello() {
        return restTemplate.getForObject("http://localhost:9005/user/hello", String.class);
    }
    
    /**
     * 通过注册中心调用hello方法
     * @return
     */
    @GetMapping("/article/callHello2")
    public String callHello2() {
    	 return restTemplate.getForObject("http://post/user/hello", String.class);
    }
    
}
